package org.adream.account.service;

import javax.annotation.PostConstruct;

import org.adream.account.service.SolrSearchService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

/**
 *	同步数据专用 
 *	包含定时 
 */
@Service
public class SyncDataService {
	
	private static final Logger logger = LoggerFactory.getLogger(SyncDataService.class);
	
	@Value ("${env}")
	String  env;//环境 dev/pro/test
	
	@Autowired
	SolrSearchService solrSearchService;
	
	@PostConstruct
	public void taskStart() {
		if("pro".equals(env)) {
			logger.debug("生产环境 定时启动...");
			solrSearchService.timingTask();
		} else {
			logger.debug("非生产环境 不启动定时...");
		}
	}
}
